#include <stdio.h>
#include <stdlib.h>
#include <winsock2.h>
#include <mysql.h>
#include <string>

#include "DataBase.h"
#include "Query.h"

int main()
{
	DataBase db("localhost","dbuser","","testdb", NULL, CLIENT_MULTI_STATEMENTS);
	Query q(db);

	q.ExecuteQuery("delete from user");
	q.ExecuteQuery("insert into user values(1,'First Person')");
	q.ExecuteQuery("insert into user values(2,'Another Person')");

	q.ExecuteQueryEx("select num,name from user");
	while (q.FetchRow())
	{
		long num = q.GetValue();
		std::string name = q.GetStr();

		printf("User#%ld: %s\n", num, name.c_str() );
	}
	q.FreeQuery();
}